﻿<phone:PhoneApplicationPage x:Class="DepSoft.Mobile.WP8.FollwIt.View.MainPage"
                            x:Name="LayoutPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:ignore="http://www.ignore.com"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"                            
                            mc:Ignorable="d ignore"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="False"
                            DataContext="{Binding Main, Source={StaticResource Locator}}">    

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <command:EventToCommand Command="{Binding ViewLoadedCommand}"
                                    PassEventArgsToCommand="True"
                                    IsEnabled="{Binding ViewLoadedCommandEnabled}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:SlideTransition Mode="SlideUpFadeIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:SlideTransition Mode="SlideDownFadeIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:SlideTransition Mode="SlideUpFadeOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:SlideTransition Mode="SlideDownFadeOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">

        <phone:LongListSelector x:Name="StreamList"
                                Margin="24,24,24,0"
                                ItemsSource="{Binding FollwItFriends}"
                                ItemTemplate="{StaticResource FollwItStreamDataTemplate}"
                                toolkit:TiltEffect.IsTiltEnabled="True"
                                />

        <Border x:Name="LoadingBorder"
                Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"
                VerticalAlignment="Top"
                Height="50" Background="#D8727070">
            <ProgressBar x:Name="LoadingProgressBar"
                            IsIndeterminate="{Binding IsBusy}"
                            Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"
                            />
        </Border>
    </Grid>

</phone:PhoneApplicationPage>